﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
//    定义一个结构体，名为PersonStruct，有三个成员变量：姓名、电话、地址，
//在主方法中，创建一个PersonStruct结构体对象p1，为p1的成员变量赋值。
//再声明一个PersonStruct结构体变量p2，把p1赋值给p2，改变p2的姓名，打印p1的内容。
    class Program
    {
        struct PersonStruct
        {
            public string name;
            public int telephone;
            public string address;

            public void PersonStructs(string name,int telephone,string address)
            {
                this.name = name;
                this.telephone = telephone;
                this.address = address;
            }
            public void pritln()
            {
                Console.WriteLine("我的名字叫{0}，我的电话号码是{1}，我的家庭住址在{2}",this.name,this.telephone,this.address);
            }
        }
        static void Main(string[] args)
        {
            PersonStruct p1;
            p1.name = "张三";
            p1.telephone = 1234568778;
            p1.address = "北京";
            p1.pritln();

            PersonStruct p2 = p1;
            p2.name = "李四";
            p1.pritln();


            PersonStruct_person p3 = new PersonStruct_person();
            p3.name = "张三";
            p3.telephone = 11234456;
            p3.address = "北京";
            p3.pritln();

            PersonStruct_person p4 = p3;
            p4.name = "赵四";
            p3.pritln();
        }
    }
}
